path bar: Use GdkEvent API
authorMatthias Clasen <mclasen@redhat.com>
Sat, 26 Aug 2017 14:57:15 +0000 (10:57 -0400)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 19 Sep 2017 16:39:03 +0000 (18:39 +0200)
gtk/gtkpathbar.c

index 28c3e843a57aa4ac44d41a99b094205c7c03fa02..b51a452cb287a6a0b78305fa71d4773a5524c67f 100644 (file)
@@ -713,7 +713,10 @@ static gboolean
 gtk_path_bar_scroll (GtkWidget      *widget,
                     GdkEventScroll *event)
 {
-  switch (event->direction)
+  GdkScrollDirection direction;
+
+  gdk_event_get_scroll_direction ((GdkEvent*)event, &direction);
+  switch (direction)
     {
     case GDK_SCROLL_RIGHT:
     case GDK_SCROLL_DOWN:
@@ -1001,8 +1004,12 @@ gtk_path_bar_slider_button_press (GtkWidget      *widget,
                                  GdkEventButton *event,
                                  GtkPathBar     *path_bar)
 {
+  guint button;
+
+  gdk_event_get_button ((GdkEvent*)event, &button);
+
   if (gdk_event_get_event_type ((GdkEvent *) event) != GDK_BUTTON_PRESS ||
-      event->button != GDK_BUTTON_PRIMARY)
+      button != GDK_BUTTON_PRIMARY)
     return FALSE;
 
   path_bar->priv->ignore_click = FALSE;